package com.stone.design.behavioral.strategy;

public class StatePatternDemo {

    public static void main(String[] args) {
        String operator = "substract";
        if ("add".equals(operator)) {
            Context context = new Context(new OperationAdd());
            System.out.println("10 + 5 = " + context.executeStrategy(10, 5));
        } else if ("substract".equals(operator)) {
            Context context = new Context(new OperationSubstract());
            System.out.println("10 - 5 = " + context.executeStrategy(10, 5));
        } else if ("multiply".equals(operator)) {
            Context context = new Context(new OperationMultiply());
            System.out.println("10 * 5 = " + context.executeStrategy(10, 5));
        }
    }
}
